// index.js
// 获取应用实例
const app = getApp()
var num = 5
Page({
  data: {
    count: 5, //倒计时
    btnBgd: "#DDDDDD", //按钮颜色
    isDisabled: true, //表示页面加载完成时disabled为启用状态
    btnPE: "none", //表示禁止点击事件
  },
  onLoad() {
    this.clickStart()
  },

  timechange:function() {
    num -= 1
    this.setData({
      count: num
    })
    if (num <= 0) {
      // this.timer && clearInterval(this.timer)
      clearInterval(this.timer)
      this.setData({
        btnBgd: "#2F54EB",
        btnPE: "all"
      })
    }
  },

  clickStart: function() {
    this.timer = setInterval(function() {
      this.timechange()
    }.bind(this), 1000)
  },

  next_calculator:function () {
    wx.navigateTo({
      url: '/pages/logs/logs',
    })
  },
})
